require 'semantictext/bulletedlist'
require 'semantictext/bullet'

module SemanticText
  class BulletedListParser

    attr_reader :bulleted_list
  
    def initialize(rich_text_parser)
      @rich_text_parser = rich_text_parser
      @bulleted_list = BulletedList.new(1)
    end
  
    def parse_line(bulleted_line)
      match = bulleted_line.match(/^(\*+)\s+(.*$)/)
      depth = match[1].size
      @bulleted_list << Bullet.new(match[2], depth, @rich_text_parser)
    end
  
  end
end